﻿// Decompiled with JetBrains decompiler
// Type: TaleWorlds.CampaignSystem.BarterSystem.BarterResult
// Assembly: TaleWorlds.CampaignSystem, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: E85F8C15-4DF6-4E9C-A58A-29177E40D07A
// Assembly location: D:\steam\steamapps\common\Mount & Blade II Bannerlord\bin\Win64_Shipping_Client\TaleWorlds.CampaignSystem.dll

using System.Collections.Generic;
using TaleWorlds.CampaignSystem.BarterSystem.Barterables;
using TaleWorlds.SaveSystem;

#nullable disable
namespace TaleWorlds.CampaignSystem.BarterSystem
{
  public class BarterResult
  {
    [SaveableField(0)]
    public readonly Hero OffererHero;
    [SaveableField(1)]
    public readonly Hero OtherHero;
    [SaveableField(2)]
    private readonly List<Barterable> _offeredBarterables;
    [SaveableField(3)]
    public readonly bool IsAccepted;

    public List<Barterable> OfferedBarters => this._offeredBarterables;

    public BarterResult(
      Hero offererHero,
      Hero otherHero,
      List<Barterable> offeredBarters,
      bool isAccepted)
    {
      this.OffererHero = offererHero;
      this.OtherHero = otherHero;
      this.IsAccepted = isAccepted;
      this._offeredBarterables = new List<Barterable>((IEnumerable<Barterable>) offeredBarters);
    }

    internal static void AutoGeneratedStaticCollectObjectsBarterResult(
      object o,
      List<object> collectedObjects)
    {
      ((BarterResult) o).AutoGeneratedInstanceCollectObjects(collectedObjects);
    }

    protected virtual void AutoGeneratedInstanceCollectObjects(List<object> collectedObjects)
    {
      collectedObjects.Add((object) this.OffererHero);
      collectedObjects.Add((object) this.OtherHero);
      collectedObjects.Add((object) this._offeredBarterables);
    }

    internal static object AutoGeneratedGetMemberValueOffererHero(object o)
    {
      return (object) ((BarterResult) o).OffererHero;
    }

    internal static object AutoGeneratedGetMemberValueOtherHero(object o)
    {
      return (object) ((BarterResult) o).OtherHero;
    }

    internal static object AutoGeneratedGetMemberValueIsAccepted(object o)
    {
      return (object) ((BarterResult) o).IsAccepted;
    }

    internal static object AutoGeneratedGetMemberValue_offeredBarterables(object o)
    {
      return (object) ((BarterResult) o)._offeredBarterables;
    }
  }
}
